home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Applications / P4⁄Mac 2.0d4 / Test programs / fibonacci.p next >
Encoding:
Text File  |  1996-09-28  |  246 b   |  17 lines  |  [TEXT/Rich]

  1. program fibonacci(input, output);
  2.  
  3. var i, this, last, next: integer;
  4.  
  5. begin
  6.     this:=1;
  7.     last :=1;
  8.     writeln(1, this);
  9.     writeln(2, last);
  10.     for i:=3 to 20 do begin
  11.         next := this + last;
  12.         last := this;
  13.         this := next;
  14.         writeln(i, this);
  15.     end;
  16. end.
  17.